home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / read.z / read
Encoding:
Text File  |  2002-10-03  |  4.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. rrrreeeeaaaadddd((((1111))))                                                                rrrreeeeaaaadddd((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      rrrreeeeaaaadddd - read a line from standard input
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      rrrreeeeaaaadddd [-r] var...
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The rrrreeeeaaaadddd utility will read a single line from standard input.
  16.  
  17.      By default, unless the ----rrrr option is specified, backslash () acts as an
  18.      escape character. If standard input is a terminal device and the invoking
  19.      shell is interactive, rrrreeeeaaaadddd will prompt for a continuation line when:
  20.  
  21.           The shell reads an input line ending with a backslash, unless the ----rrrr
  22.           option is specified.
  23.  
  24.           A here-document is not terminated after a newline character is
  25.           entered.
  26.  
  27.      The line will be split into fields as in the shell; the first field will
  28.      be assigned to the first variable var, the second field to the second
  29.      variable var, and so on. If there are fewer var operands specified than
  30.      there are fields, the leftover fields and their intervening separators
  31.      will be assigned to the last var. If there are fewer fields than vars,
  32.      the remaining vars will be set to empty strings.
  33.  
  34.      The setting of variables specified by the var operands will affect the
  35.      current shell execution environment; see Shell Execution Environment.  If
  36.      it is called in a subshell or separate utility execution environment,
  37.      such as one of the following:
  38.  
  39.  
  40.           (read foo)
  41.           nohup read ...
  42.           find . -exec read ... \;
  43.  
  44.      it will not affect the shell variables in the caller's environment.
  45.  
  46. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  47.      The rrrreeeeaaaadddd utility supports the XBD specification, Utility Syntax
  48.      Guidelines.
  49.  
  50.      The following option is supported:
  51.  
  52.      ----rrrr    Do not treat a backslash character in any special way. Consider
  53.            each backslash to be part of the input line.
  54.  
  55. OOOOPPPPEEEERRRRAAAANNNNDDDDSSSS
  56.      The following operands are supported:
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. rrrreeeeaaaadddd((((1111))))                                                                rrrreeeeaaaadddd((((1111))))
  71.  
  72.  
  73.  
  74.      var   The name of an existing or non-existing shell variable.
  75.  
  76. SSSSTTTTDDDDIIIINNNN
  77.      The standard input must be a text file.
  78.  
  79. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  80.      The following environment variables affect the execution of read:
  81.  
  82.      IIIIFFFFSSSS   Determine the internal field separators used to delimit fields.
  83.  
  84.      PPPPSSSS2222   Provide the prompt string that an interactive shell will write to
  85.            standard error when a line ending with a backslash is read and the
  86.            ----rrrr option was not specified, or if a here-document is not
  87.            terminated after a newline character is entered.
  88.  
  89. EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
  90.      The following exit values are returned:
  91.            0 Successful completion.  >0 End-of-file was detected or an error
  92.            occurred.
  93.  
  94. AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNN UUUUSSSSAAAAGGGGEEEE
  95.      The rrrreeeeaaaadddd utility has historically been a shell built-in.
  96.  
  97.      The ----rrrr option is included to enable read to subsume the purpose of the
  98.      line utility, which has been marked LEGACY.
  99.  
  100.      The results are undefined if an end-of-file is detected following a
  101.      backslash at the end of a line when ----rrrr is not specified.
  102.  
  103. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  104.      The following command:
  105.  
  106.  
  107.           while read -r xx yy
  108.           do
  109.                printf "%s %s0 "$yy" "$xx"
  110.           done < input_file
  111.  
  112.      prints a file with the first field of each line moved to the end of the
  113.      line.
  114.  
  115. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  116.      sssshhhh((((1111))))....
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.